/*************************************************************************
    > File Name: test.c
    > Author: ma6174
    > Mail: ma6174@163.com 
    > Created Time: Tue 04 Mar 2025 10:19:12 PM CST
 ************************************************************************/

#include<stdio.h>
#include<string.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>

#define ONE 1                // 1  0000 0001
#define TWO (1<<1)           // 2  0000 0010          左移1位
#define THREE (1<<2)         // 3  0000 0100          左移2位
#define FOUR (1<<3)          // 4  0000 1000          左移3位
			
void print(int flag)
{
	if(flag & ONE)
		printf("one\n");

	if(flag & TWO)
		printf("two\n");

	if(flag & THREE)
		printf("three\n");

	if(flag & FOUR)
		printf("four\n");

}

int main()
{
	print(ONE);
	printf("\n");

	print(TWO);
	printf("\n");
	
	print(THREE);
	printf("\n");
	
	print(FOUR);
	printf("\n");
	
	print(ONE|TWO);
	printf("\n");
	
	print(ONE|TWO|THREE);
	printf("\n");

	print(ONE|TWO|THREE|FOUR);
	printf("\n");
	return 0;
}
